﻿'use strict';
var port = process.env.PORT || 1337;


//Web Socket Demo测试
//const express = require('express');
//const app = express();
//const expressWs = require('express-ws');
//const ws = require('./server/webSocket')(express);
//expressWs(app);
//app.use(express.static('wwwroot'));
//app.use('/websocket', ws);

//app.listen(port, () => {
//    console.log(`server is listening on port ${port}`);
//});

/*
 * 
 * koa demo 
require('./server/koaDemo')(port);

//var koa = require('koa');
//var bodyparser = require('koa-bodyparser');
//var controller = require('./controller');

//var app = new koa();

//app.use(bodyparser());
//app.use(controller(__dirname));

*/

const express = require('express');
const app = express();

let etag = 0;
app.get('/test', (req, res) => {
    etag++;
    res.send('hello http');
    res.send('ETag', etag);
});

app.listen(port, () => {
    console.log('The Server is running at http://127.0.0.1:');
});